//
//  FoodTherapyTableViewCell.m
//  Happy Kitchen
//
//  Created by dlios on 15/3/7.
//  Copyright (c) 2015年 mac_chen. All rights reserved.
//

#import "FoodTherapyTableViewCell.h"

@implementation FoodTherapyTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSub];
    }
    return self;
}

- (void)createSub
{
    //图片
    self.therapyImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 50, 50)];
    self.therapyImageView.userInteractionEnabled = YES;
    //设置图片为圆形
    [self.therapyImageView.layer setCornerRadius:CGRectGetHeight([self.therapyImageView bounds]) / 2];
    self.therapyImageView.layer.masksToBounds = YES;
    [self.contentView addSubview:self.therapyImageView];
    
    //主标题
    self.officNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 10, self.frame.size.width - 80, 25)];
    [self.contentView addSubview:self.officNameLabel];
    
    //副标题
    self.diseaseNamesLabel = [[UILabel alloc] initWithFrame:CGRectMake(80, 40, self.frame.size.width - 80, 25)];
    self.diseaseNamesLabel.font = [UIFont systemFontOfSize:15];
    [self.contentView addSubview:self.diseaseNamesLabel];



}

//自定义方法,赋值
- (void)setFoodTherapy:(FoodTherapy *)foodTherapy
{
    self.officNameLabel.text = foodTherapy.officeName;
    self.diseaseNamesLabel.text = foodTherapy.diseaseNames;
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
